package org.hot100_3;

import java.util.ArrayList;
import java.util.List;

public class leetcode94 {
    public List<Integer> inorderTraversal(TreeNode root) {

        List<Integer> res = new ArrayList<>();

        dfs(root,res);

        return res;
    }

    private void dfs (TreeNode root,List<Integer> res){
        if (root==null){
            return;
        }

        dfs(root.left,res);

        res.add(root.val);

        dfs(root.right,res);
    }
}
